package net.wanho.controller;

import lombok.RequiredArgsConstructor;
import net.wanho.service.FileService;
import net.wanho.vo.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequiredArgsConstructor
@RequestMapping
public class FileController {
    private final FileService fileService;
    @PostMapping("/upload")
    public R upload(MultipartFile file) {
      String url =  fileService.uploadFile(file);
      return R.success("文件上传成功",url);

    }
}
